home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9227 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6d 63 | 68 68 2e 73 69 65 6d 65 |Path: mc|hh.sieme|
|00000010| 6e 73 2e 64 65 21 6e 65 | 77 73 0a 46 72 6f 6d 3a |ns.de!ne|ws.From:|
|00000020| 20 52 6f 6e 61 6c 64 20 | 46 69 73 63 68 65 72 20 | Ronald |Fischer |
|00000030| 3c 72 6f 6e 61 6c 64 2e | 66 69 73 63 68 65 72 40 |<ronald.|fischer@|
|00000040| 75 65 62 65 6d 63 2e 73 | 69 65 6d 65 6e 73 2e 64 |uebemc.s|iemens.d|
|00000050| 65 3e 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |e>.Newsg|roups: c|
|00000060| 6f 6d 70 2e 6c 61 6e 67 | 2e 63 2b 2b 0a 53 75 62 |omp.lang|.c++.Sub|
|00000070| 6a 65 63 74 3a 20 52 65 | 3a 20 48 65 6c 70 20 77 |ject: Re|: Help w|
|00000080| 69 74 68 20 63 6f 6e 76 | 65 72 74 69 6e 67 20 73 |ith conv|erting s|
|00000090| 74 72 69 6e 67 20 74 6f | 20 66 6c 6f 61 74 2c 20 |tring to| float, |
|000000a0| 70 6c 65 61 73 65 21 21 | 21 0a 44 61 74 65 3a 20 |please!!|!.Date: |
|000000b0| 32 39 20 46 65 62 20 31 | 39 39 36 20 30 38 3a 33 |29 Feb 1|996 08:3|
|000000c0| 39 3a 34 38 20 47 4d 54 | 0a 4f 72 67 61 6e 69 7a |9:48 GMT|.Organiz|
|000000d0| 61 74 69 6f 6e 3a 20 53 | 69 65 6d 65 6e 73 20 41 |ation: S|iemens A|
|000000e0| 47 2c 28 48 6f 66 6d 61 | 6e 6e 73 74 72 29 20 20 |G,(Hofma|nnstr) |
|000000f0| 4d 75 6e 69 63 68 2d 47 | 65 72 6d 61 6e 79 2d 45 |Munich-G|ermany-E|
|00000100| 75 72 6f 70 65 2e 0a 4d | 65 73 73 61 67 65 2d 49 |urope..M|essage-I|
|00000110| 44 3a 20 3c 34 68 33 6f | 6f 6b 24 72 37 6c 40 6d |D: <4h3o|ok$r7l@m|
|00000120| 6f 6f 64 79 2e 6d 63 68 | 68 2e 73 69 65 6d 65 6e |oody.mch|h.siemen|
|00000130| 73 2e 64 65 3e 0a 52 65 | 66 65 72 65 6e 63 65 73 |s.de>.Re|ferences|
|00000140| 3a 20 3c 34 68 32 30 38 | 6c 24 61 6a 61 40 6e 65 |: <4h208|l$aja@ne|
|00000150| 77 73 31 2e 73 75 6e 62 | 65 6c 74 2e 6e 65 74 3e |ws1.sunb|elt.net>|
|00000160| 0a 4e 4e 54 50 2d 50 6f | 73 74 69 6e 67 2d 48 6f |.NNTP-Po|sting-Ho|
|00000170| 73 74 3a 20 74 68 65 6d | 73 65 2e 6d 63 68 68 2e |st: them|se.mchh.|
|00000180| 73 69 65 6d 65 6e 73 2e | 64 65 0a 4d 69 6d 65 2d |siemens.|de.Mime-|
|00000190| 56 65 72 73 69 6f 6e 3a | 20 31 2e 30 0a 43 6f 6e |Version:| 1.0.Con|
|000001a0| 74 65 6e 74 2d 54 79 70 | 65 3a 20 74 65 78 74 2f |tent-Typ|e: text/|
|000001b0| 70 6c 61 69 6e 3b 20 63 | 68 61 72 73 65 74 3d 75 |plain; c|harset=u|
|000001c0| 73 2d 61 73 63 69 69 0a | 43 6f 6e 74 65 6e 74 2d |s-ascii.|Content-|
|000001d0| 54 72 61 6e 73 66 65 72 | 2d 45 6e 63 6f 64 69 6e |Transfer|-Encodin|
|000001e0| 67 3a 20 37 62 69 74 0a | 58 2d 4d 61 69 6c 65 72 |g: 7bit.|X-Mailer|
|000001f0| 3a 20 4d 6f 7a 69 6c 6c | 61 20 31 2e 31 4e 20 28 |: Mozill|a 1.1N (|
|00000200| 58 31 31 3b 20 49 3b 20 | 53 75 6e 4f 53 20 35 2e |X11; I; |SunOS 5.|
|00000210| 33 20 73 75 6e 34 6d 29 | 0a 54 6f 3a 20 6b 62 65 |3 sun4m)|.To: kbe|
|00000220| 72 72 79 40 73 61 66 65 | 66 65 64 2e 6f 72 67 0a |rry@safe|fed.org.|
|00000230| 58 2d 55 52 4c 3a 20 6e | 65 77 73 3a 34 68 32 30 |X-URL: n|ews:4h20|
|00000240| 38 6c 24 61 6a 61 40 6e | 65 77 73 31 2e 73 75 6e |8l$aja@n|ews1.sun|
|00000250| 62 65 6c 74 2e 6e 65 74 | 0a 0a 6b 62 65 72 72 79 |belt.net|..kberry|
|00000260| 40 73 61 66 65 66 65 64 | 2e 6f 72 67 20 28 4b 65 |@safefed|.org (Ke|
|00000270| 76 69 6e 29 20 77 72 6f | 74 65 3a 0a 3e 49 20 6e |vin) wro|te:.>I n|
|00000280| 65 65 64 20 74 6f 20 70 | 61 72 73 65 20 75 70 20 |eed to p|arse up |
|00000290| 61 20 73 74 72 69 6e 67 | 20 61 6e 64 20 70 65 72 |a string| and per|
|000002a0| 66 6f 72 6d 20 63 61 6c | 63 75 6c 61 74 69 6f 6e |form cal|culation|
|000002b0| 73 20 6f 6e 20 74 68 65 | 20 76 61 72 69 61 62 6c |s on the| variabl|
|000002c0| 65 73 2e 0a 3e 0a 3e 74 | 61 6b 65 20 74 68 69 73 |es..>.>t|ake this|
|000002d0| 20 73 74 72 69 6e 67 20 | 63 68 61 72 20 2a 51 75 | string |char *Qu|
|000002e0| 65 72 79 3d 22 41 50 52 | 3d 38 2e 39 26 54 45 52 |ery="APR|=8.9&TER|
|000002f0| 4d 3d 35 26 41 4d 4f 55 | 4e 54 3d 31 30 30 30 30 |M=5&AMOU|NT=10000|
|00000300| 22 0a 3e 0a 3e 48 6f 77 | 20 77 6f 75 6c 64 20 49 |".>.>How| would I|
|00000310| 20 70 61 72 73 65 20 69 | 74 20 75 70 20 61 6e 64 | parse i|t up and|
|00000320| 20 74 61 6b 65 20 6f 75 | 74 20 74 68 65 20 6e 75 | take ou|t the nu|
|00000330| 6d 62 65 72 73 20 73 6f | 20 49 20 63 61 6e 20 75 |mbers so| I can u|
|00000340| 73 65 20 74 68 65 6d 20 | 69 6e 20 66 6c 6f 61 74 |se them |in float|
|00000350| 69 6e 67 20 0a 3e 70 6f | 69 6e 74 20 63 61 6c 63 |ing .>po|int calc|
|00000360| 75 6c 61 74 69 6f 6e 73 | 3f 0a 3e 54 68 65 6e 20 |ulations|?.>Then |
|00000370| 49 20 6e 65 65 64 20 74 | 6f 20 70 75 74 20 74 68 |I need t|o put th|
|00000380| 65 6d 20 62 61 63 6b 20 | 69 6e 20 61 20 73 74 72 |em back |in a str|
|00000390| 69 6e 67 20 66 6f 72 20 | 6f 75 74 70 75 74 2e 0a |ing for |output..|
|000003a0| 3e 0a 50 61 72 73 69 6e | 67 3a 0a 20 20 4d 65 74 |>.Parsin|g:. Met|
|000003b0| 68 6f 64 20 31 3a 20 4d | 61 6b 65 20 61 20 6c 6f |hod 1: M|ake a lo|
|000003c0| 6f 70 20 6f 76 65 72 20 | 74 68 65 20 73 74 72 69 |op over |the stri|
|000003d0| 6e 67 20 74 6f 20 6c 6f | 63 61 74 65 20 74 68 65 |ng to lo|cate the|
|000003e0| 20 64 69 67 69 74 73 20 | 28 73 65 65 20 66 75 6e | digits |(see fun|
|000003f0| 63 74 69 6f 6e 20 0a 20 | 20 20 20 27 69 73 64 69 |ction . | 'isdi|
|00000400| 67 69 74 27 29 2c 20 6f | 72 20 75 73 65 20 27 73 |git'), o|r use 's|
|00000410| 74 72 74 6f 6b 27 20 74 | 6f 20 66 69 6e 64 20 74 |trtok' t|o find t|
|00000420| 68 65 20 6e 75 6d 65 72 | 69 63 20 70 6f 72 74 69 |he numer|ic porti|
|00000430| 6f 6e 73 20 6f 66 20 74 | 68 65 20 73 74 72 69 6e |ons of t|he strin|
|00000440| 67 2e 0a 20 20 20 20 54 | 68 65 6e 20 75 73 65 20 |g.. T|hen use |
|00000450| 27 61 74 6f 66 27 20 74 | 6f 20 65 78 74 72 61 63 |'atof' t|o extrac|
|00000460| 74 20 74 68 65 20 6e 75 | 6d 62 65 72 73 2e 0a 20 |t the nu|mbers.. |
|00000470| 20 4d 65 74 68 6f 64 20 | 32 3a 20 49 66 20 79 6f | Method |2: If yo|
|00000480| 75 20 6b 6e 6f 77 20 74 | 68 65 20 67 65 6e 65 72 |u know t|he gener|
|00000490| 61 6c 20 6c 61 79 6f 75 | 74 20 6f 66 20 79 6f 75 |al layou|t of you|
|000004a0| 72 20 73 74 72 69 6e 67 | 2c 20 75 73 65 20 73 63 |r string|, use sc|
|000004b0| 61 6e 66 20 77 69 74 68 | 0a 20 20 20 20 61 6e 20 |anf with|. an |
|000004c0| 61 70 70 72 6f 70 72 69 | 61 74 65 20 66 6f 72 6d |appropri|ate form|
|000004d0| 61 74 2e 0a 20 20 4d 65 | 74 68 6f 64 20 33 3a 20 |at.. Me|thod 3: |
|000004e0| 49 6e 69 74 69 61 6c 69 | 7a 65 20 61 6e 20 69 73 |Initiali|ze an is|
|000004f0| 74 72 73 74 72 65 61 6d | 20 77 69 74 68 20 74 68 |trstream| with th|
|00000500| 65 20 73 74 72 69 6e 67 | 20 61 6e 64 20 75 73 65 |e string| and use|
|00000510| 20 74 68 65 20 6d 65 6d | 62 65 72 0a 20 20 20 20 | the mem|ber. |
|00000520| 66 75 6e 63 74 69 6f 6e | 73 20 27 67 65 74 27 20 |function|s 'get' |
|00000530| 28 65 78 74 72 61 63 74 | 20 6e 65 78 74 20 63 68 |(extract| next ch|
|00000540| 61 72 61 63 74 65 72 29 | 2c 20 27 70 65 65 6b 27 |aracter)|, 'peek'|
|00000550| 20 28 6c 6f 6f 6b 20 61 | 74 20 6e 65 78 74 20 63 | (look a|t next c|
|00000560| 68 61 72 61 63 74 65 72 | 29 0a 20 20 20 20 61 6e |haracter|). an|
|00000570| 64 20 27 6f 70 65 72 61 | 74 6f 72 3e 3e 28 64 6f |d 'opera|tor>>(do|
|00000580| 75 62 6c 65 26 29 27 20 | 28 65 78 74 72 61 63 74 |uble&)' |(extract|
|00000590| 20 6e 65 78 74 20 6e 75 | 6d 62 65 72 29 2e 0a 50 | next nu|mber)..P|
|000005a0| 75 74 74 69 6e 67 20 62 | 61 63 6b 20 66 6f 72 20 |utting b|ack for |
|000005b0| 6f 75 74 70 75 74 3a 0a | 20 20 4d 65 74 68 6f 64 |output:.| Method|
|000005c0| 20 31 3a 20 55 73 65 20 | 73 70 72 69 6e 74 66 20 | 1: Use |sprintf |
|000005d0| 77 69 74 68 20 61 6e 20 | 61 70 70 72 6f 70 72 69 |with an |appropri|
|000005e0| 61 74 65 20 66 6f 72 6d | 61 74 2e 0a 20 20 4d 65 |ate form|at.. Me|
|000005f0| 74 68 6f 64 20 32 3a 20 | 55 73 65 20 61 6e 20 6f |thod 2: |Use an o|
|00000600| 73 74 72 73 74 72 65 61 | 6d 2e 20 45 78 61 6d 70 |strstrea|m. Examp|
|00000610| 6c 65 3a 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |le:. | |
|00000620| 20 20 6f 73 74 72 73 74 | 72 65 61 6d 20 6f 73 74 | ostrst|ream ost|
|00000630| 72 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |r;. | |
|00000640| 20 6f 73 74 72 3c 3c 22 | 4e 75 6d 62 65 72 22 3c | ostr<<"|Number"<|
|00000650| 3c 6d 79 5f 6e 75 6d 62 | 65 72 3c 3c 65 6e 64 73 |<my_numb|er<<ends|
|00000660| 3b 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|00000670| 63 68 61 72 20 63 6f 6e | 73 74 2a 20 73 74 72 3d |char con|st* str=|
|00000680| 6f 73 74 72 2e 73 74 72 | 28 29 3b 0a 20 20 20 20 |ostr.str|();. |
|00000690| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 75 73 65 | | /* use|
|000006a0| 20 73 74 72 20 2a 2f 0a | 20 20 20 20 20 20 20 20 | str */.| |
|000006b0| 20 20 20 20 20 20 64 65 | 6c 65 74 65 20 5b 5d 20 | de|lete [] |
|000006c0| 73 74 72 3b 0a 0a 52 6f | 6e 61 6c 64 0a 0a |str;..Ro|nald.. |
+--------+-------------------------+-------------------------+--------+--------+